/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 *
 * ***************************************************************************/

namespace Microsoft.Scripting.Ast {
    internal partial class StackSpiller {

        private delegate Result Rewriter(StackSpiller ar, Expression expr, Stack stack);

        private static readonly Rewriter[] _Rewriters = {

            #region Generated Ast Rewriter

            // *** BEGIN GENERATED CODE ***
            // generated by function: gen_ast_rewriter from: generate_tree.py

            RewriteBinaryExpression,                                    //    Add
            RewriteBinaryExpression,                                    //    AddChecked
            RewriteBinaryExpression,                                    //    And
            RewriteLogicalBinaryExpression,                             //    AndAlso
            RewriteUnaryExpression,                                     //    ArrayLength
            RewriteBinaryExpression,                                    //    ArrayIndex
            RewriteMethodCallExpression,                                //    Call
            RewriteBinaryExpression,                                    //    Coalesce
            RewriteConditionalExpression,                               //    Conditional
            RewriteConstantExpression,                                  //    Constant
            RewriteUnaryExpression,                                     //    Convert
            RewriteUnaryExpression,                                     //    ConvertChecked
            RewriteBinaryExpression,                                    //    Divide
            RewriteBinaryExpression,                                    //    Equal
            RewriteBinaryExpression,                                    //    ExclusiveOr
            RewriteBinaryExpression,                                    //    GreaterThan
            RewriteBinaryExpression,                                    //    GreaterThanOrEqual
            RewriteInvocationExpression,                                //    Invoke
            RewriteLambdaExpression,                                    //    Lambda
            RewriteBinaryExpression,                                    //    LeftShift
            RewriteBinaryExpression,                                    //    LessThan
            RewriteBinaryExpression,                                    //    LessThanOrEqual
                                                                        // ** ListInit
            RewriteMemberExpression,                                    //    MemberAccess
                                                                        // ** MemberInit
            RewriteBinaryExpression,                                    //    Modulo
            RewriteBinaryExpression,                                    //    Multiply
            RewriteBinaryExpression,                                    //    MultiplyChecked
            RewriteUnaryExpression,                                     //    Negate
            RewriteUnaryExpression,                                     //    UnaryPlus
            RewriteUnaryExpression,                                     //    NegateChecked
            RewriteNewExpression,                                       //    New
            RewriteNewArrayExpression,                                  //    NewArrayInit
            RewriteNewArrayExpression,                                  //    NewArrayBounds
            RewriteUnaryExpression,                                     //    Not
            RewriteBinaryExpression,                                    //    NotEqual
            RewriteBinaryExpression,                                    //    Or
            RewriteLogicalBinaryExpression,                             //    OrElse
            RewriteParameterExpression,                                 //    Parameter
            RewriteBinaryExpression,                                    //    Power
            RewriteUnaryExpression,                                     //    Quote
            RewriteBinaryExpression,                                    //    RightShift
            RewriteBinaryExpression,                                    //    Subtract
            RewriteBinaryExpression,                                    //    SubtractChecked
            RewriteUnaryExpression,                                     //    TypeAs
            RewriteTypeBinaryExpression,                                //    TypeIs
            RewriteActionExpression,                                    //    ActionExpression
            RewriteAssignmentExpression,                                //    Assign
            RewriteBlock,                                               //    Block
            RewriteBreakStatement,                                      //    BreakStatement
            RewriteLambdaExpression,                                    //    Generator
            RewriteContinueStatement,                                   //    ContinueStatement
            RewriteDeleteExpression,                                    //    Delete
            RewriteDoStatement,                                         //    DoStatement
            RewriteEmptyStatement,                                      //    EmptyStatement
            RewriteLabeledStatement,                                    //    LabeledStatement
            RewriteLocalScopeExpression,                                //    LocalScope
            RewriteLoopStatement,                                       //    LoopStatement
            RewriteUnaryExpression,                                     //    OnesComplement
            RewriteReturnStatement,                                     //    ReturnStatement
            RewriteScopeExpression,                                     //    Scope
            RewriteSwitchStatement,                                     //    SwitchStatement
            RewriteThrowStatement,                                      //    ThrowStatement
            RewriteTryStatement,                                        //    TryStatement
            RewriteVariableExpression,                                  //    Variable
            RewriteYieldStatement,                                      //    YieldStatement
            RewriteExtensionExpression,                                 //    Extension

            // *** END GENERATED CODE ***

            #endregion
        };
    }
}

